package com.chen.im;

import com.chen.common.Lang;
import com.chen.common.ScreenUtils;
import com.chen.im.page.MainPageView;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;

import de.felixroske.jfxsupport.AbstractJavaFxApplicationSupport;
import javafx.application.Platform;
import javafx.scene.Scene;
import javafx.stage.Stage;

@SpringBootApplication
@MapperScan("com.chen")
@ComponentScan("com.chen")
public class ImApplication extends AbstractJavaFxApplicationSupport {

    public static void main(String[] args) {
        launch(ImApplication.class, MainPageView.class,args);
        //SpringApplication.run(ImApplication.class, args);
    }

    @Override
    public void beforeInitialView(Stage stage, ConfigurableApplicationContext ctx) {
        Scene scene = stage.getScene();
        stage.setWidth(ScreenUtils.getScreenW()*0.6);
        stage.setHeight(ScreenUtils.getScreenH()*0.7);
        stage.setTitle(Lang.get("sys.appName"));
        //scene.getStylesheets().add("org/kordamp/bootstrapfx/bootstrapfx.css");
        stage.setResizable(false); //禁止随意调整窗口大小
        super.beforeInitialView(stage, ctx);
    }

}
